/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package iteracon.generator.iterator;

import java.util.Iterator;

/**
 *
 * @author martin
 */
public class FromZeroToIter implements Iterator<Integer>{
    private final int _size;
    private int _index;
    
    public FromZeroToIter(int size){
      _size=size;
      _index=0;
    }
    
    @Override
    public boolean hasNext() {
      return _index<_size;
    }

    @Override
    public Integer next() {
      return _index++;
    }

    @Override
    public void remove() {
      throw new UnsupportedOperationException("Immutable");
    }
    
  }